package com.cmrx.model.service.impl;

import com.cmrx.model.dao.CommonAttachmentDao;
import com.cmrx.model.entity.CommonAttachment;
import com.cmrx.model.service.CommonAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by angle on 2019/2/16.
 */
@Service
@Transactional
public class CommonAttachmentServiceImpl implements CommonAttachmentService {

    @Autowired
    private CommonAttachmentDao commonAttachmentDao;

    /**
     * 根据id查找附件文件信息
     * @param id
     * @return
     */
    @Override
    public CommonAttachment queryById(String id) {
        return commonAttachmentDao.queryById(id);
    }

    /**
     * 根据id删除附件文件信息
     * @param id
     * @return
     */
    @Override
    public int deleteById(String id) {
        return commonAttachmentDao.deleteById(id);
    }

    /**
     * 添加附件文件信息
     * @param attachment
     * @return
     */
    @Override
    public int addAttachment(CommonAttachment attachment) {
        return commonAttachmentDao.addAttachment(attachment);
    }

    /**
     * 修改附件文件信息
     * @param attachment
     * @return
     */
    @Override
    public int updateById(CommonAttachment attachment) {
        return commonAttachmentDao.updateById(attachment);
    }
}
